<?php

require_once('utils.php');
function get_request_token($appid,$appkey)
{
$url    = 'http://openapi.qzone.qq.com/oauth/qzoneoauth_request_token?';
$sigstr = 'GET'.'&'.rawurlencode('http://openapi.qzone.qq.com/oauth/qzoneoauth_request_token').'&';
$params = array();
$params['oauth_version']          = '1.0';
$params['oauth_signature_method'] = 'HMAC-SHA1';
$params['oauth_timestamp']        = time();
$params['oauth_nonce']            = mt_rand();
$params['oauth_consumer_key']     = $appid;
$normalized_str = get_normalized_string($params);
$sigstr        .= rawurlencode($normalized_str);
$key = $appkey.'&';
$signature = get_signature($sigstr,$key);
$url      .= $normalized_str.'&'.'oauth_signature='.rawurlencode($signature);
return file_get_contents($url);
}
?>